package com.rookie.im.minio;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.minio.MinioClient;
import lombok.Data;

@Data
@Configuration
@ConfigurationProperties("spring.minio")
public class MiniConfig {
	private String accessKey;
	private String secretKey;
	private String url;
	private String bucketName;
	@Bean
	public MinioClient minioClient() {
		return MinioClient.builder()
			.endpoint(url)
			.credentials(accessKey, secretKey)
			.build();
	}
}
